<?php
/* $Id: update.users.php,v 1.3 2003/10/08 07:26:01 tuxmonkey Exp $ */
/**
 * @package Issue-Tracker
 * @subpackage Users
 */

if (strpos($_SERVER['PHP_SELF'],basename(__FILE__)) !== false) {
  print "Direct module access forbidden.";exit;}

if (!is_employee()) {
  redirect();
}

if (!errors()){

    if(is_array($_POST['add_groups'])){
        foreach($_POST['add_groups'] as $key => $val){
            group_useradd($_GET['usrid'],$val);
        }
    }

    if(is_array($_POST['del_groups'])){
        foreach($_POST['del_groups'] as $key => $val){
            group_userdel($_GET['usrid'],$val);
        }
    }

  gen_cache("users","userid","username");
}

redirect("?module=users&action=view&usrid=".$_GET['usrid']);
?>